﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Jinjia.Approve.Entity.Entity.JJFlow;
using Jinjia.Approve.Model.Input.JJFlow;
using Jinjia.Approve.Model.VM;
using Jinjia.Core.BaseInfrastructure.StorageModel.Model;

namespace Jinjia.Approve.IRepository.JJFlow
{
    public interface IFlowMappingRepository
    {
        /// <summary>
        /// 根据模块ID获取 template
        /// </summary>
        /// <param name="modular_key"></param>
        /// <returns></returns>
        Task<jj_flow_mapping_tbl> GetByModularKey(string modular_key);

        /// <summary>
        /// 根据工作流模板id获取对应业务类型字典列表
        /// </summary>
        /// <param name="templateID"></param>
        /// <returns></returns>
        Task<Dictionary<int, string>> GetByTemplateID(int templateID);

        /// <summary>
        /// 通过ids获取业务类型列表
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        Task<List<jj_flow_mapping_tbl>> GetMappingByIds(List<int> ids);

        /// <summary>
        /// 批量更新清空template_id
        /// </summary>
        /// <param name="templateId"></param>
        /// <param name="id"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task UpdateMappingTemplateId(int templateId, List<int> id, int userId);

        Task ClearTemplateIDByTemplateID(int templateID, int userId);

        /// <summary>
        /// 业务列表
        /// </summary>
        /// <param name="searchCondition"></param>
        /// <param name="user_id"></param>
        /// <returns></returns>
        Task<PageListSearchResultVM<JJMappingViewModel>> GetMappingPageList(JJMappingSearchCondition searchCondition, int user_id);

        Task<int> GetMappingCount(string modular_key, int id);

        Task<jj_flow_mapping_tbl> GetMappingId(int id);

        Task<int> Save(jj_flow_mapping_tbl data);
    }
}